home *** CD-ROM | disk | FTP | other *** search
/ Light ROM 1 / LIGHT-ROM 1 (Amiga Library Services)(1994).iso / ffdisks / d883.lha / BBBBS / BBBBS59.lha / rexx / TestArc.rexx < prev   
OS/2 REXX Batch file  |  1993-06-12  |  1KB  |  40 lines

  1. /* $VER: TestArc.rexx 5.9 (12.6.93)
  2. copyright 1990-93 Richard Lee Stockton
  3.        FREELY DISTRIBUTABLE
  4.  
  5.      Required in C: directory:
  6.     arc dms lha unarj unzip zoo
  7. */
  8.  
  9. OPTIONS FAILAT 999
  10. CR='0D'x
  11. PARSE ARG argname .
  12. endtest=UPPER(RIGHT(argname,4))
  13. arcomm=''
  14. IF endtest='.ARC' THEN arcomm='c:arc >TestArc.txt t'
  15. ELSE IF endtest='.ARJ' THEN arcomm='c:unarj >TestArc.txt t'
  16. ELSE IF endtest='.DMS' THEN arcomm='c:dms >TestArc.txt VIEW'
  17. ELSE IF endtest='.ZOO' THEN arcomm='c:zoo >TestArc.txt -t'
  18. ELSE IF endtest='.ZIP' THEN arcomm='c:unzip >TestArc.txt -t'
  19. ELSE IF endtest='.LHA' | endtest='.LZH' THEN
  20.   arcomm='c:lha >TestArc.txt -N t'
  21. IF arcomm='' THEN EXIT 0
  22.  
  23. SAY 'Testing archive integrity...'CR
  24. ADDRESS COMMAND'CD RAM:' || '0A'x || arcomm argname
  25. err=RC
  26. IF err>0 THEN
  27.   DO
  28.     CALL DELAY(100)
  29.     x=OPEN(f,'RAM:TestArc.txt','R')
  30.     IF x=0 THEN
  31.       DO i=1 WHILE ~EOF(f)
  32.         SAY READLN(f)||CR
  33.       END
  34.     CALL CLOSE(f)
  35.   END
  36. ELSE SAY ' - Archive tested OK -'CR
  37. EXIT err
  38.  
  39. /* TestArc.rexx */
  40.